package com.jinlejia.erp.utils;

import com.jinlejia.erp.bean.ShareShopAndAgentBean;

import java.io.Serializable;
import java.util.Comparator;

/**
 * @author SongJiaTai
 * @description:根据拼音排序共享店和经纪人
 * @date :2019/11/12 18:39
 */
public class PinyinComparatorShareShopAndAgent implements Comparator<ShareShopAndAgentBean>, Serializable {
    @Override
    public int compare(ShareShopAndAgentBean o1, ShareShopAndAgentBean o2) {
        if ("@".equals(o1.getSortLetters())
                || "#".equals(o2.getSortLetters())) {
            return -1;
        } else if (("#").equals(o1.getSortLetters())
                || "@".equals(o2.getSortLetters())) {
            return 1;
        } else {
            return o1.getSortLetters().compareTo(o2.getSortLetters());
        }
    }
}
